package self.vector.ding.dao.mybatis.generator.plugin;

import org.mybatis.generator.api.dom.java.Method;
import org.mybatis.generator.api.dom.xml.XmlElement;

public class InsertBatchOraclePlugin extends AbstractInsertBatchPlugin {

	/* (non-Javadoc)
	 * @see self.vector.ding.dao.mybatis.generator.plugin.AbstractInsertBatchPlugin#generateInsertBatchMethod(org.mybatis.generator.api.dom.java.Method)
	 */
	@Override
	public boolean generateInsertBatchMethod(Method method) {
		return true;
	}

	/* (non-Javadoc)
	 * @see self.vector.ding.dao.mybatis.generator.plugin.AbstractInsertBatchPlugin#generateInsertBatchXmlElement(org.mybatis.generator.api.dom.xml.XmlElement, org.mybatis.generator.api.dom.xml.XmlElement)
	 */
	@Override
	protected boolean generateInsertBatchXmlElement(XmlElement insertElement, XmlElement foreachElement) {
		return true;
	}

	/* (non-Javadoc)
	 * @see self.vector.ding.dao.mybatis.generator.plugin.AbstractInsertBatchPlugin#getColumnsPrefix()
	 */
	@Override
	protected String getColumnsPrefix() {
		return "(";
	}

	/* (non-Javadoc)
	 * @see self.vector.ding.dao.mybatis.generator.plugin.AbstractInsertBatchPlugin#getColumnsSuffix()
	 */
	@Override
	protected String getColumnsSuffix() {
		return ")";
	}

	/* (non-Javadoc)
	 * @see self.vector.ding.dao.mybatis.generator.plugin.AbstractInsertBatchPlugin#getValuesPrefix()
	 */
	@Override
	protected String getValuesPrefix() {
		return "( select";
	}

	/* (non-Javadoc)
	 * @see self.vector.ding.dao.mybatis.generator.plugin.AbstractInsertBatchPlugin#getValuesSuffix()
	 */
	@Override
	protected String getValuesSuffix() {
		return "from dual )";
	}

	/* (non-Javadoc)
	 * @see self.vector.ding.dao.mybatis.generator.plugin.AbstractInsertBatchPlugin#getForeachSeparator()
	 */
	@Override
	protected String getForeachSeparator() {
		return "union all";
	}
	
}